package com.lwy.service.impl;

import com.lwy.domain.Student;
import com.lwy.service.TrainClassService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.Map;

@Component
public class TrainClassFactory {

    @Autowired
    private Map<String, TrainClassService> trainClassServiceMap;

    public Student handle(String beanName) {
        TrainClassService trainClassService = trainClassServiceMap.get(beanName);
        Student student = trainClassService.getStudent();
        return student;
    }

}
